***********************************************************
**************REPLICATION CODE FOR FIGURES*****************
*************HIGH PROFILE CRIMINAL VIOLENCE"***************
***********************************************************

*Figure 1. Evolution of Criminal Attacks against Government Officials and Party Members, 1995-2012
use "Figure1_timetrend_1995-2012", clear
#delimit
twoway (line total year, lcolor(black) lwidth(medthick)) 
(line authorities year, lpattern(dash) lcolor(gs3) lwidth(medthick)) 
(line  parties  year, lpattern(shortdash) lcolor(gs7) lwidth(medthick)), 
legend(cols(1)) xlabel(1995(1)2012, angle(forty_five)) scheme(s1mono) 
xtitle("Year") ytitle("Number of attacks") 
xline(2006, lpattern(dash) lcolor(gs9)) 
text(95 2006 "Federal intervention", place(e) bfcolor(white) margin(small));
#delimit cr

*Figure 2. Criminal Attacks by Target and Level of Government, 2007-2012
use "Figure2_levelgovt_2007-2012.dta", clear
#delimit
graph bar (asis) percentage, over(level_gov, sort(percentage)) ylabel(0(20)87)
over(position) ytitle(Percentage of attacks) scheme(s1mono) blabel(total);
#delimit cr

*Figure 3. Criminal Attacks by Target and Party, 2007-2012
use "Figure3_parties_2007-2012.dta", clear
#delimit
graph bar (asis) authority activist , over( party ) blabel(total) scheme(s1mono) 
legend(label(1 "Government officials") label(2 "Party candidates & activists") cols(1));
#delimit cr

*Figure 4. Attacks vs. governed municipalities
use "Figure4_attacks_vs_governed.dta", clear
#delimit
twoway (scatter attack_perc mayor_perc , sort mlabel( party ) 
xtitle("Percentage of municipalities ruled by party") 
ytitle("Percentage of attacks by party")
legend(off) scheme(s1mono) ysize(4) xsize(4)) (line h h2, lpattern(dash) ) ;
#delimit cr

*Figure 5. Election cycles, 2006-2012
use "Figure5_electoralcycles_2006-2012.dta", clear
#delimit
xtline attacks, lcolor(black) lwidth(medthick) i(state) t(year) 
addplot((spike election year, lpattern(shortdash))) 
ytitle("Number of attacks") ttitle("Year") tlabel(2006(1)2012, angle(forty_five)) 
ylabel(0(20)40) scheme(s1mono) 
legend(label(1 "Attacks") label(2 "Election year"));
#delimit cr


*Maps 1-3 were created with QGIS using the file "Dataset_HighProfileCriminalViolence.dta"

